package com.itheima.factory_review;

import com.itheima.factory.Car;
import com.itheima.factory.Mobile;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

/**
 * @program: design
 * @description:
 * @author: zhanghz001
 * @create: 2021-02-27 10:24
 **/
public class BeanFactoryTest {
    public static void main(String[] args) {
        ClassPathResource resource = new ClassPathResource("spring-factory.xml");
        XmlBeanFactory factory = new XmlBeanFactory(resource);
        Car car = (Car) factory.getBean("car");
        car.show();
        Mobile mobile = (Mobile) factory.getBean("mobile");
        mobile.show();
    }
}
